package liceo;
import javax.swing.ButtonGroup;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

/**
 *
 * @author kndidox
 */
public class panelAl extends JPanel
{
     private JLabel NomEtiqueta,apeEtiqueta,lnEtiqueta,MunEtiqueta,estEtiqueta;
     private JLabel fenaEtiqueta,sxEtiqueta,emailEtiqueta,vvEtiqueta;
     private JLabel nperEtiqueta,infaEtiqueta,tiviEtiqueta,pobeEtiqueta;
     private JLabel dihaEtiqueta,gresEtiqueta;
     protected JTextField nomText,apeText,lnText,munText,estText;
     protected JTextField emailText,vvText,nperText,infaText,tiviText,dihaText;
     protected JTextField naText,esText,tpCBT;
     private JComboBox dcb,mcb,acb,gresCB;
     public  JComboBox tpbCB;
     protected JRadioButton mrb,frb,erb,nrb,orb,srb,norb;
     private ButtonGroup pbBG,sxRB,beRB;
    panelAl()
    {
        this.setLayout(null);
        NomEtiqueta = new JLabel("Nombres del Alumno");
        NomEtiqueta.setBounds(20,20,140,20);
        this.add(NomEtiqueta);

        nomText = new JTextField (150);
        nomText.setBounds(150,20,120,20);
        this.add(nomText);
        tecladoControlador ctrTeclado = new tecladoControlador(this);
        nomText.addKeyListener(ctrTeclado);

        apeEtiqueta = new JLabel("Apellidos del Alumno");
        apeEtiqueta.setBounds(300,20,120,20);
        this.add(apeEtiqueta);

        apeText = new JTextField(150);
        apeText.setBounds(430,20,120,20);
        this.add(apeText);

        lnEtiqueta = new JLabel("Lugar de Nacimiento");
        lnEtiqueta.setBounds(20,50,120,20);
        this.add(lnEtiqueta);

        lnText = new JTextField(100);
        lnText.setBounds(150,50,120,20);
        this.add(lnText);

        MunEtiqueta = new JLabel("Municipio");
        MunEtiqueta.setBounds(300,50,80,20);
        this.add(MunEtiqueta);

        munText = new JTextField(80);
        munText.setBounds(430,50,120,20);
        this.add(munText);

        estEtiqueta = new JLabel("Estado");
        estEtiqueta.setBounds(570,50,80,20);
        this.add(estEtiqueta);

        estText = new JTextField(80);
        estText.setBounds(700,50,80,20);
        this.add(estText);

        fenaEtiqueta = new JLabel("Fecha de Nacimiento");
        fenaEtiqueta.setBounds(20,80,120,20);
       this.add(fenaEtiqueta);
        String dia []={"-","1","2","3","4","5","6","7","8","9","10","11","12","13",
            "14","15","16","17","18","19","20","21","22","23","24","25","26","27",
            "28","29","30","31"};
        dcb = new JComboBox(dia);
        dcb.setBounds(150,80,40,20);
        this.add(dcb);

        String mes []={"--","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio",
            "Agosto","Septiembre","Octubre","Noviembre","Diciembre"};
        mcb = new JComboBox(mes);
        mcb.setBounds(190,80,100,20);
        this.add(mcb);
        
        gresEtiqueta = new JLabel("Grado que va a Cursar");
        gresEtiqueta.setBounds(430,100,150,20);
        this.add(gresEtiqueta);

        String grest []={"--","1ro","2do","3ro","4to","5to","6to","7mo","8vo"
                ,"9no","4to año","5to año"};
        gresCB = new JComboBox (grest);
        gresCB.setBounds(590,100,80,20);
        this.add(gresCB);

        String año []={"---","1988","1989","1990","1991","1992","1993","1994","1995",
            "1996","1997","1998","1999","2000","2001","2002","2003","2004","2005",
            "2006","2007","2008","2009","2010"};
        acb =new JComboBox(año);
        acb.setBounds(290,80,80,20);
        this.add(acb);

        String tipobeca []={"---","Nacional","Estadal","Otra"};
        tpbCB = new JComboBox(tipobeca);
        tpbCB.setBounds(120,260,80,20);
        this.add(tpbCB);

        tpCBT = new JTextField (60);
        tpCBT.setBounds(230,260,80,20);
        this.add(tpCBT);

        sxEtiqueta = new JLabel("Sexo");
        sxEtiqueta.setBounds(20,110,70,20);
        this.add(sxEtiqueta);

        mrb = new JRadioButton("Masculino");
        mrb.setBounds(110,110,90,20);
        this.add(mrb);

        frb = new JRadioButton("Femenino");
        frb.setBounds(220,110,90,20);
        this.add(frb);

        sxRB = new ButtonGroup();
        sxRB.add(mrb);
        sxRB.add(frb);

        dihaEtiqueta = new JLabel ("Direccion de Habitacion");
        dihaEtiqueta.setBounds(20,140,140,20);
        this.add(dihaEtiqueta);

        dihaText = new JTextField (200);
        dihaText.setBounds(170,140,350,20);
        this.add(dihaText);

        emailEtiqueta = new JLabel("Correo Electronico");
        emailEtiqueta.setBounds(20,170,120,20);
        this.add(emailEtiqueta);

        emailText = new JTextField(50);
        emailText.setBounds(170,170,120,20);
        this.add(emailText);

        vvEtiqueta = new JLabel ("Vive con");
        vvEtiqueta.setBounds(300,170,80,20);
        this.add(vvEtiqueta);

        vvText = new JTextField (30);
        vvText.setBounds(430,170,80,20);
        this.add(vvText);

        nperEtiqueta = new JLabel ("Numero de Personas");
        nperEtiqueta.setBounds(570,170,120,20);
        this.add(nperEtiqueta);

        nperText = new JTextField (30);
        nperText.setBounds(700,170,120,20);
        this.add(nperText);

        infaEtiqueta = new JLabel ("Ingreso Familiar");
        infaEtiqueta.setBounds(20,200,120,20);
        this.add(infaEtiqueta);

        infaText = new JTextField (200);
        infaText.setBounds(170,200,120,20);
        this.add(infaText);

        tiviEtiqueta = new JLabel ("Tipo de Vivienda");
        tiviEtiqueta.setBounds(300,200,120,20);
        this.add(tiviEtiqueta);

        tiviText = new JTextField (50);
        tiviText.setBounds(430,200,120,20);
        this.add(tiviText);

        pobeEtiqueta = new JLabel ("Posee Beca");
        pobeEtiqueta.setBounds(20,230,80,20);
        this.add(pobeEtiqueta);

        srb = new JRadioButton("Si");
        srb.setBounds(120,230,50,20);
        this.add(srb);

        norb = new JRadioButton("No");
        norb.setBounds(170,230,50,20);
        this.add(norb);

        pbBG = new ButtonGroup();
        pbBG.add(srb);
        pbBG.add(norb);
 
        itemAl botones = new itemAl(this);
        srb.addItemListener(botones);
        norb.addItemListener(botones);

    }//fin del constructor
    //Getters!
    public String getnomText()
    {
        return nomText.getText();
    }

    public String getapeText()
    {
        return apeText.getText();
    }

    public String getlnText()
    {
        return lnText.getText();
    }

    public String getmunText()
    {
        return munText.getText();
    }

    public String getestText()
    {
        return estText.getText();
    }

    public String getemailText()
    {
        return emailText.getText();
    }

    public String getvvText()
    {
        return vvText.getText();
    }

    public int getnperText()
    {
        return Integer.parseInt(nperText.getText());
    }

    public float getinfaText()
    {
        return Float.parseFloat(infaText.getText());
    }

    public String gettiviText()
    {
        return tiviText.getText();
    }

    public String getnaText()
    {
        return naText.getText();
    }
    //estado!!
    public String getesText()
    {
        return esText.getText();
    }

    public String gettpCBT()
    {
        return tpCBT.getText();
    }

    public String getdihaText()
    {
        return dihaText.getText();
    }
    //Setters
    public void setnomText(String nom)
    {
        nomText.setText(nom);
    }

}
